import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'flutter_plugin_print_a300_platform_interface.dart';

/// An implementation of [FlutterPluginPrintA300Platform] that uses method channels.
class MethodChannelFlutterPluginPrintA300 extends FlutterPluginPrintA300Platform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel = const MethodChannel('flutter_plugin_print_a300');

  @override
  Future<String?> getPlatformVersion() async {
    final version = await methodChannel.invokeMethod<String>('getPlatformVersion');
    return version;
  }

  //获取打印设备集合
  @override
   Future<dynamic> addressList() async {
    var list = await methodChannel.invokeMethod('addressList');
    return list;
  }

  //执行打印
  @override
  Future<String>  nativePrint(Map<String, String> dataJson, String? blueAddress) async {
    final version = await methodChannel.invokeMethod('nativePrint', {"dataJson": dataJson, "blueAddress": blueAddress});
    return version;
  }

}
